<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<title>就业信息列表</title>
<c:import url="/WEB-INF/jsp/head.jsp" />
<link rel="stylesheet"
	href="static/css/bootstrap-datetimepicker.min.css">
<script type="text/javascript"
	src="static/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
	src="static/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript" src="static/js/employment/list.js"></script>
<style type="text/css">
.form-inline .form-group {
	margin-bottom: 15px !important;
}
</style>
</head>
<body>
	<div class="default-theme container-fluid iframe">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">搜索条件</div>
				<div class="panel-body">
					<form class="form-inline" action="employment/list" method="post">
						<div class="form-group">
							<label for="product.id">产品类型：</label> <select
								name="classes.product.id" class="form-control">
								<option value="">所有</option>
								<c:forEach items="${products }" var="product">
									<option value="${product.value }"
										<c:if test="${student.classes.product.id == product.value }">selected</c:if>>${product.name }</option>
								</c:forEach>
							</select>
						</div>
						<div class="form-group">
							<label for="educatoin.value">学历：</label> <select
								name="education.value" class="form-control">
								<option value="">所有</option>
								<c:forEach items="${educations }" var="item">
									<option value="${item.value }"
										<c:if test="${item.value == student.education.value }"> selected="selected"</c:if>>${item.name }</option>
								</c:forEach>
							</select>
						</div>
						<div class="form-group">
							<label for="name">姓名:</label> <input type="text"
								class="form-control" name="name" id="name"
								value="${student.name }" />
						</div>
						<div class="form-group">
							<label for="classes.name">班级:</label> <select
								class="form-control" id="classes.name" name="classes.name">
								<option value="">请选择：</option>
								<c:forEach items="${classes }" var="item">
									<option
										<c:if test="${student.classes.name eq item.name }">selected</c:if>
										value="${item.name }">${item.name }</option>
								</c:forEach>
							</select>
						</div>
						<div class="form-group">
							<label for="">薪资：</label> <input type="number" name="min"
								class="form-control " value="${salary.min }" placeholder="￥" />-
							<input type="number" name="max" class="form-control "
								value="${salary.max }" placeholder="￥" />
						</div>
						<div class="form-group">
							<label for="">就业时间：</label>
							<div class="input-group">
								<input type="text" id="startDate" name="startDate"
									class="form-control" readonly="readonly"
									value="<fmt:formatDate value='${employmentDate.startDate}' pattern='yyyy-MM-dd'  />"
									placeholder="开始时间" /> <span class="input-group-btn">
									<button class="btn btn-defualt" type="button"
										onclick="clearDate(this)">
										<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
									</button>
								</span>
							</div>

							-
							<div class="input-group">
								<input type="text" id="endDate" name="endDate"
									class="form-control" readonly="readonly"
									value="<fmt:formatDate value='${employmentDate.endDate}' pattern='yyyy-MM-dd'  />"
									placeholder="结束时间" /> <span class="input-group-btn">
									<button class="btn btn-default" onclick="clearDate(this)"
										type="button">
										<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
									</button>
								</span>
							</div>
						</div>
						<div class="form-group">

							<button type="submit" class="btn btn-default">搜索</button>
						</div>
						<div class="form-group">
							<button type="button" data-type="export" class="btn btn-default">
								<span class="glyphicon glyphicon-save">导出</span>
							</button>
						</div>
						<input type="hidden" id="pageNum" name="pageNum" />
					</form>
				</div>
			</div>
		</div>
		<div class="col-md-12">
			<table class="table table-hover table-border table-condensed table-center">
				<thead>
					<tr>
						<th style="min-width: 5em;">产品名称</th>
						<th style="min-width: 5em;max-width:5em;">姓名</th>
						<th style="min-width: 6em;">手机号码</th>
						<th style="min-width: 6em;">毕业时间</th>
						<th style="min-width: 3em;">学历</th>
						<th style="min-width: 4.7em;">就业城市</th>
						<th style="min-width: 6em;">入职时间</th>
						<th>公司名称</th>
						<th style="min-width: 6em;">工作职位</th>
						<th style="min-width: 6em;max-width: 8.4em;">原职业</th>
						<th style="min-width: 6em;">转正薪资</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(pageInfo.list) == 0 }">
						<tr align="center">
							<td colspan="14">没有查询到数据</td>
						</tr>
					</c:if>
					<c:forEach items="${pageInfo.list }" var="item">
						<tr>
							<td>
								${item.student.classes.product.name }
							</td>
							<td><a href="employment/info?id=${item.id }"
								data-title="就业详情">${item.student.name }</a></td>
							<td>${item.student.tel }</td>
							<td>
								<fmt:formatDate value='${item.student.classes.endDate}' pattern='yyyy-MM-dd' />
							</td>
							<td>${item.student.education.name }</td>
							<td>${item.employmentCity }</td>
							<td>
								<fmt:formatDate value='${item.employmentDate}' pattern='yyyy-MM-dd' />
							</td>
							<td title="${item.companyName }">
								<div class="hide-content" style="max-width: 13em;">
									<span>${item.companyName }</span>
								</div>
							</td>
							<td>${item.job }</td>
							<td title="${item.student.previousJob }" style="max-width: 8.4em;">
								<div class="hide-content">
									<span>${item.student.previousJob }</span>
								</div>
							</td>
							<td>${item.salary }</td>
							<td>
								<button type="button" class="btn btn-primary btn-xs" data-title="修改就业"
									employmentId="${item.id }" onclick="updateEmp(this)">
									<span class="glyphicon glyphicon-pencil" aria-hidden="true">修改</span>
								</button>
								<button type="button" class="btn btn-danger btn-xs"
									data-toggle="modal" data-target="#delete"
									studentName="${item.student.name }" employmentId="${item.id }"
									onclick="todel(this)">
									<span class="glyphicon glyphicon-trash" aria-hidden="true">删除</span>
								</button>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<c:import url="/WEB-INF/jsp/paging.jsp" />
		</div>
	</div>
	<div class="modal fade" id="result" tabindex="-1" rose="dialog"
		aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<a class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">&times;</span></a>
					<h4 class="modal-title">提示</h4>
				</div>
				<div class="modal-body">
					<span id="response"></span>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="delete" tabindex="-1" role="dialog">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title">确认操作</h4>
				</div>
				<div class="modal-body">
					<p>是否确认删除以下数据?</p>
					<p id="msg"></p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button data-type="submit" type="button" id="delEmployment"
						class="btn btn-primary">确定</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>